{extend name="public/base" /}
{block name="body"}
<div class="layui-fluid">
    <div class="layui-row">
    	<div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
    		<div class="widget-head">
				<div class="widget-title">{$title}</div>
			</div>
    		<form id="my-form" class="layui-form" method="post">
    			<div class="widget-body layui-col-lg12">
    				<div class="layui-form-item">
						<label class="layui-form-label form-require">优惠券名称</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="name" value="{$info.name}" placeholder="请输入优惠券名称" required>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label form-require">优惠券类型</label>
						<div class="layui-input-inline">
							<input type="radio" name="type" value="1" title="满减券" {eq name="info['type']" value="1"}checked{/eq}>
                    		<input type="radio" name="type" value="2" title="折扣券" {eq name="info['type']" value="2"}checked{/eq}>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label form-require">优惠金额</label>
						<div class="layui-input-inline">
							<input type="text" class="layui-input" name="discount" value="{$info.discount}" placeholder="请输入优惠金额" required>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label form-require">满足金额</label>
						<div class="layui-input-inline">
							<input type="text" class="layui-input" name="price" value="{$info.price}" placeholder="请输入满足金额" required>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label form-require">开始时间</label>
						<div class="layui-input-inline">
							<input type="text" class="layui-input" id="start_time" name="start_time" placeholder="yyyy-MM-dd" value="{$info.start_time}">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label form-require">结束时间</label>
						<div class="layui-input-inline">
							<input type="text" class="layui-input" id="end_time" name="end_time" placeholder="yyyy-MM-dd" value="{$info.end_time}">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label form-require">优惠券数量</label>
						<div class="layui-input-inline">
							<input type="text" class="layui-input" name="num" placeholder="请输入优惠券数量" value="{$info.num}">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label form-require">状态</label>
						<div class="layui-input-inline">
							<input type="radio" name="status" value="1" title="启用" {eq name="info['status']" value="1"}checked{/eq}>
                    		<input type="radio" name="status" value="0" title="禁用" {eq name="info['status']" value="0"}checked{/eq}>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<input type="hidden" name="id" value="{$info.id}">
							<button class="layui-btn" lay-filter="*" lay-submit="">保存</button>
                    		<button class="layui-btn layui-btn-primary" onclick="javascript:history.back(-1);return false;">返回</button>
						</div>						
					</div>
    			</div>
    		</form>
    	</div>
    </div>
</div>
{/block}
{block name="js"}
<script>
layui.use('laydate', function(){
  var laydate = layui.laydate;
  laydate.render({
    elem: '#start_time'
  });
  laydate.render({
  	elem: '#end_time'
  });
});
</script>
{/block}